<template>
  <div style="padding: 10px;">
    <Row label="字段标题" :required="true">
      <a-input v-model="fieldConfig.label"/>
    </Row>

    <Row label="字段名称" :required="true">
      <a-input v-model="fieldConfig.fieldName"/>
    </Row>

    <Row label="字段标题名称">
      <a-input v-model="fieldConfig.fieldTitleName"/>
    </Row>

    <Row label="输入提示">
      <a-input v-model="fieldConfig.placeholder"/>
    </Row>

    <Row label="绑定枚举" :required="true">
      <DictBinder :field-config="fieldConfig"/>
    </Row>

    <FieldValueFormulaGroups :fieldConfig="fieldConfig" :formDefinition="formDefinition"/>
  </div>
</template>

<script>
import {createProps} from '@/utils';
import {createField, createFormDefinition} from '@/components/hhd/design/FormDesigner/types';
import Row from '@/components/hhd/design/FormDesigner/base/Row.vue';
import DictBinder from '@comp/hhd/design/FormDesigner/DictBinder/DictBinder.vue';
import FieldValueFormulaGroups
  from '@comp/hhd/design/FormDesigner/field/comps/form/FieldValueFormulaGroups/FieldValueFormulaGroups.vue';

function createRadioField() {
  let res = createField();
  res.component = 'radio'
  return res;
}

export default {
  name: "RadioConfig",
  components: {FieldValueFormulaGroups, DictBinder, Row},
  props: {
    formDefinition: createProps(Object, createFormDefinition),
    fieldConfig: createProps(Object, createRadioField),
  }
}
</script>

<style scoped>

</style>
